﻿using Microsoft.AspNetCore.Mvc;
using M56.Model.Barrage.Dto;

namespace M56.Admin.WebApi.Controllers.Barrage
{
    /// <summary>
    /// 江湖对决
    /// </summary>
    [Route("/goc")]
    [AllowAnonymous]
    public class JhGocController : BaseController
    {
        /// <summary>
        /// 提交客户端信息
        /// </summary>
        /// <returns></returns>
        [Route("clientinfo")]
        [HttpPost]
        public IActionResult ClientInfo([FromBody] JhClientInfoDto info)
        {
            var data = new Dictionary<string, object>
            {
                { "MustUpgrade", false },
                { "DownloadUrl", "" }
            };

            var result = new Dictionary<string, object>
            {
                { "Code", 0 },
                { "Msg", "success" },
                { "Data", data }
            };

            return Ok(result);
        }

        /// <summary>
        /// 获取公告
        /// </summary>
        /// <returns></returns>
        [Route("notice")]
        [HttpPost]
        public IActionResult Notice([FromBody] JhClientInfoDto info)
        {
            var data = new Dictionary<string, object>
            {
                { "Version", 1715153743 },
                { "Title", "标题" },
                { "Content", "【更新公告】\n\n1. BUG修复及体验优化\n" },
                { "Time", DateTime.Now.ToTimestamp(TimestampType.Second) },
                { "Show", true }
            };

            var result = new Dictionary<string, object>
            {
                { "Code", 0 },
                { "Msg", "success" },
                { "Data", data }
            };

            return Ok(result);
        }
    }
}
